﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XingLucifer.IBase.Enums;
using XingLucifer.IBase;
using UIWindows.Tools.Helper;

namespace UIWindows.Services
{
    public class ScanCodeHook
    {
        public ScanCodeHook()
        {

        }



        private bool WriteInjectionVolume(float value_inj, IDevices devices, int address, string method)
        {
            for (int i = 1; i < 4; i++)
            {
                if (devices.WriteSingle(value_inj, address + (method == "字节" ? 12 : 6), 0, 0))
                {
                    $"第[{i}]次 注液量 [{value_inj:F2}] 写入成功".RunLog(MessageLevelType.信息);
                    return true;
                }
                else
                {
                    $"第[{i}]次 注液量 [{value_inj:F2}] 写入失败".RunLog(MessageLevelType.警告);
                }
            }
            return false;
        }
    }
}
